Skip to content

ci: run @cipherstash/bench smoke tests on changes#431

Open
auxesis wants to merge 4 commits intomainfrom
ci/smoke-test-bench-package
Open

ci: run @cipherstash/bench smoke tests on changes#431
auxesis wants to merge 4 commits intomainfrom
ci/smoke-test-bench-package

Conversation

@auxesis
Copy link
Copy Markdown
Contributor

@auxesis auxesis commented May 6, 2026

Benchmark suite was added in #424.

This PR adds a CI workflow to run smoke tests on changes to the benchmark suite.

This should only run on changes to:

  • @cipherstash/bench
  • local/
  • the workflow

The smoke suite is intentionally credential-free: bench falls back to the docker-compose default DATABASE_URL, so no secrets are wired in.

Note: the smoke tests are failing due to two known issues. Once fixes are landed in other PRs, this PR will be rebased.

The smoke tests were previously failing because of two known issues, however it looks like the tests weren't being filtered, and were being run incorrectly.

Summary by CodeRabbit

  • Chores
    • Strengthened continuous integration infrastructure with automated performance benchmarking and comprehensive testing workflows. These enhancements ensure application reliability and performance standards are continuously validated across pull requests and deployments, helping maintain consistent quality throughout the development lifecycle.

Adds a third job (`bench-smoke-tests`) to `.github/workflows/tests.yml`
that brings up the EQL-enabled Postgres container under `local/` and
runs `pnpm test:local -- db-only` against it.

The job is gated by a small `changes` filter job using
`dorny/paths-filter@v3` so it only runs when files under
`packages/bench/**`, `local/**`, or `.github/workflows/tests.yml`
change. Existing `run-tests` and `e2e-tests` jobs are untouched and
continue to fire on every push/PR.

The smoke suite is intentionally credential-free: bench falls back to
the docker-compose default DATABASE_URL, so no secrets are wired in.

Note: the suite currently surfaces two known-failing assertions in
`drizzle/operators.explain.test.ts` (the eq/inArray bare-equality
bug). The failures will appear red on this PR — that's the intent;
the fix lands in a stacked branch.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@auxesis auxesis requested a review from a team as a code owner May 6, 2026 10:11
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 6, 2026

⚠️ No Changeset found

Latest commit: 7275ed9

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@auxesis auxesis force-pushed the ci/smoke-test-bench-package branch from 33d3aca to 423e08c Compare May 6, 2026 10:13
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 6, 2026

📝 Walkthrough

Walkthrough

A new GitHub Actions workflow is introduced that automatically runs benchmark tests on pushes to main and pull requests affecting the bench/ and local/ directories. The workflow sets up Node.js and pnpm, builds the @cipherstash/stack package, starts a PostgreSQL environment via Docker Compose, and executes bench smoke tests.

Changes

Benchmark Testing Workflow

Layer / File(s) Summary
Workflow Trigger & Job Setup
.github/workflows/tests-bench.yml (lines 1–23)
Defines workflow name "Test JS", triggers on pushes and pull requests with path filters for packages/bench, local, and workflow file changes. Declares "tests-bench" job with runner configuration.
Environment Preparation
.github/workflows/tests-bench.yml (lines 24–44)
Checks out repository, installs pnpm, sets up Node.js 22 with pnpm caching, and explicitly installs node-gyp for binary rebuild support.
Dependency Installation & Package Build
.github/workflows/tests-bench.yml (lines 45–54)
Installs project dependencies using pnpm with frozen lockfile, then builds @cipherstash/stack package via turbo with appropriate filtering.
Service Startup & Test Execution
.github/workflows/tests-bench.yml (lines 55–60)
Starts local PostgreSQL (EQL) environment via Docker Compose, then runs bench smoke tests targeting the db-only scenario.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Possibly related issues

Poem

🐰 Hoppy hop, the benchmarks now run fast,
With PostgreSQL in Docker, built to last,
Each push triggers tests through GitHub's might,
Performance tracked day and night!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically describes the main change: introducing a CI workflow to run smoke tests for the @cipherstash/bench package on relevant changes.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch ci/smoke-test-bench-package

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@auxesis auxesis force-pushed the ci/smoke-test-bench-package branch from 423e08c to 76855f8 Compare May 6, 2026 10:15
Move `bench-smoke-tests` (and drop the `dorny/paths-filter` `changes`
job) out of `tests.yml` into its own `.github/workflows/tests-bench.yml`.

Path-gating is now handled by the workflow's own `on: push/pull_request:
paths:` filter, so no extra job + dependency wiring is needed and the
existing `Test JS` workflow stays untouched.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@auxesis auxesis force-pushed the ci/smoke-test-bench-package branch from 76855f8 to 5c029f5 Compare May 6, 2026 10:21
`pnpm test:local` runs vitest directly without going through turbo, so
the `^build` dep declared on the `test` task in turbo.json doesn't
fire — and `@cipherstash/stack`'s dist/-based `exports` map fails to
resolve from `__tests__/harness.test.ts` and
`__tests__/drizzle/operators.explain.test.ts`. Build the package
explicitly via turbo (cached) before invoking vitest.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/tests-bench.yml:
- Around line 63-65: The "Run bench smoke tests" workflow step is currently
blocking despite known failures; update that step (the job step named "Run bench
smoke tests") to be temporarily non-blocking by adding continue-on-error: true
under that step and include a TODO note referencing an issue or a remove-by date
(e.g., TODO: remove when upstream fix XYZ-123 is merged) so it is explicit and
reversible; revert this change once the upstream fixes land.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 1e024ce3-5305-4802-9a6a-265c6e647ad0

📥 Commits

Reviewing files that changed from the base of the PR and between e57b53f and 0e2f46d.

📒 Files selected for processing (1)
  • .github/workflows/tests-bench.yml

Comment thread .github/workflows/tests-bench.yml Outdated
Comment on lines +63 to +65
- name: Run bench smoke tests
working-directory: packages/bench
run: pnpm test:local -- db-only
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot May 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Known failing smoke tests should be temporarily non-blocking.

Per the PR objective, this step is expected to fail right now. Leaving it blocking will keep relevant PRs red and can stall merges. Make this temporary and explicit (for example, continue-on-error: true with a TODO/remove-by reference), then revert once the upstream fixes land.

Suggested temporary change
       - name: Run bench smoke tests
         working-directory: packages/bench
+        continue-on-error: true # temporary until known smoke failures are fixed
         run: pnpm test:local -- db-only
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/tests-bench.yml around lines 63 - 65, The "Run bench smoke
tests" workflow step is currently blocking despite known failures; update that
step (the job step named "Run bench smoke tests") to be temporarily non-blocking
by adding continue-on-error: true under that step and include a TODO note
referencing an issue or a remove-by date (e.g., TODO: remove when upstream fix
XYZ-123 is merged) so it is explicit and reversible; revert this change once the
upstream fixes land.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, I said what I said:

Note: the smoke tests are failing due to two known issues. Once fixes are landed in other PRs, this PR will be rebased.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@auxesis Understood, thanks for the clarification. Acknowledged — the PR will stay as-is and be rebased once the upstream fixes land.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Never mind that if I'd followed this recommendation, that would have hidden the true cause of the test failure 7275ed9

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@auxesis, that's a fair and important point — keeping the step blocking is exactly what surfaced the root cause, whereas continue-on-error: true would have swallowed the signal entirely. My recommendation was wrong here. Thanks for the correction.

(╥_╥)


✏️ Learnings added
Learnt from: auxesis
Repo: cipherstash/stack PR: 431
File: .github/workflows/tests-bench.yml:0-0
Timestamp: 2026-05-06T11:35:47.341Z
Learning: In GitHub Actions workflows, do not recommend `continue-on-error: true` as a workaround for "known failing" test steps. Masking failures with `continue-on-error: true` hides the true cause of test failures and makes root cause analysis harder. It is better to leave steps blocking so that genuine failures surface clearly and can be diagnosed and fixed. This applies even when failures are described as "known" or "expected" in a PR description.

Note: Learnings are effective only in the context of similar code segments. To apply general coding guidelines, please configure review instructions. You can manage existing learnings in the app.

`pnpm test:local -- db-only` was forwarding `-- db-only` to vitest,
which interprets `--` as the option-terminator and ignores the
trailing positional. The result: all 3 test files ran, and
`harness.test.ts` + `drizzle/operators.explain.test.ts` failed in
setup with `[encryption]: Not authenticated` because they need
CipherStash credentials we deliberately don't wire into this job.

Drop the `--`. pnpm 10 forwards script args directly, and vitest
applies `db-only` as a path filter — narrowing to the credential-free
`__tests__/db-only.test.ts` (4 tests).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant